﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ThaiTrungSolution
{
    public partial class Excercise01 : Form
    {
        public Excercise01()
        {
            InitializeComponent();
        }
     

        private void btnDangnhap_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtTennguoidung.Text))
            {
                MessageBox.Show("Ban chua dang nhap", "Thong bao", MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
            }
            else if (string.IsNullOrEmpty(txtMatkhau.Text))
            {
                MessageBox.Show("Ban chua nhap mat khau", "Thong bao", MessageBoxButtons.OK,
                    MessageBoxIcon.Exclamation);
            }
            else if (txtTennguoidung.Text.Equals("Thai trung") && txtMatkhau.Text.Equals("nothing"))
            {
                MessageBox.Show("Ban da dang nhap thanh cong", "Thong bao", MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Thong tin dang nhap khong dung","Thong bao",MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            if(MessageBox.Show("Ban co chac muon thoat khoi ung dung","Thong bao",MessageBoxButtons.OKCancel,
                MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
            {
                Application.Exit();
            }
        }
    }
}
